package com.yipao.db.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import com.yipao.db.domain.YipaoAdmin;
import com.yipao.db.domain.YipaoAdminExample;

/**
 * 管理员
 *
 * @author tianhao
 */
public interface AdminMapper {

    long countByExample(YipaoAdminExample example);


    int deleteByExample(YipaoAdminExample example);


    int deleteByPrimaryKey(Integer id);


    int insert(YipaoAdmin record);


    int insertSelective(YipaoAdmin record);


    YipaoAdmin selectOneByExample(YipaoAdminExample example);


    YipaoAdmin selectOneByExampleSelective(@Param("example") YipaoAdminExample example, @Param("selective") YipaoAdmin.Column... selective);


    List<YipaoAdmin> selectByExampleSelective(@Param("example") YipaoAdminExample example, @Param("selective") YipaoAdmin.Column... selective);


    List<YipaoAdmin> selectByExample(YipaoAdminExample example);


    YipaoAdmin selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") YipaoAdmin.Column... selective);


    YipaoAdmin selectByPrimaryKey(Integer id);


    YipaoAdmin selectByPrimaryKeyWithLogicalDelete(@Param("id") Integer id, @Param("andLogicalDeleted") boolean andLogicalDeleted);


    int updateByExampleSelective(@Param("record") YipaoAdmin record, @Param("example") YipaoAdminExample example);


    int updateByExample(@Param("record") YipaoAdmin record, @Param("example") YipaoAdminExample example);


    int updateByPrimaryKeySelective(YipaoAdmin record);


    int updateByPrimaryKey(YipaoAdmin record);


    int logicalDeleteByExample(@Param("example") YipaoAdminExample example);


    int logicalDeleteByPrimaryKey(Integer id);

    /**
     * 运维端,根据微信openId查询
     *
     * @param weixinOpenid
     * @param deleted      删除状态
     * @return
     */
    YipaoAdmin queryByWeixinOpenId(@Param("weixinOpenid") String weixinOpenid, @Param("deleted") Integer deleted);

    /**
     * 运维端,根据手机号码查询
     *
     * @param mobile 手机号码
     * @param deleted      删除状态
     * @return
     */
    YipaoAdmin queryByMobile(@Param("mobile") String mobile,@Param("deleted") Integer deleted);
}
